package com.example.chapter09;

import java.util.StringJoiner;

public class test5 {
    public static void main(String[] args) {
        String name = "张三";
        int score = 85;
        System.out.printf("Name: %s, Score: %d%n", name, score);


        StringJoiner joiner = new StringJoiner(", ", "[", "]");
        joiner.add("Apple");
        joiner.add("Banana");
        joiner.add("Orange");
        String fruits = joiner.toString();
        System.out.println(fruits);


        StringBuilder builder = new StringBuilder();
        builder.append("Hello");
        builder.append(" ");
        builder.append("World");
        String message = builder.toString();
        System.out.println(message);
    }
}
